
import request from '@/utils/request'
//获取图片列表
export const reqSpuImageList = (spuId) => request({ url: `/admin/product/spuImageList/${spuId}`, method: 'GET' })

//售卖属性信息
export const reqSpuSaleAttrList = (spuId) => request({ url: `/admin/product/spuSaleAttrList/${spuId}`, method: "GET" })

export const reqAttrInfoList = (category1Id, category2Id, category3Id) => request({ url: `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`, method: "GET" })


//添加sku
export const reqAddSku = (skuInfo) => request({ url: '/admin/product/saveSkuInfo', method: 'POST', data: skuInfo })


//获取sku列表数据的接口
export const reqSkuList = (spuId) => request({ url: `/admin/product/findBySpuId/${spuId}`, method: "GET" })


export const reqDelete = (spuId) => request({ url: `/admin/product/deleteSpu/${spuId}`, method: "DELETE" })





export const reqSkuList1 = (page, limit) => request({ url: `/admin/product/list/${page}/${limit}`, method: "GET" })


//上架和下架的接口
export const reqSale = (skuId) => request({ url: `/admin/product/onSale/${skuId}`, method: "GET" })

export const reqCancel = (skuId) => request({ url: `/admin/product/cancelSale/${skuId}`, method: "GET" })

//获取sku详情
export const reqSkuById = (skuId) => request({ url: `/admin/product/getSkuById/${skuId}`, method: "GET" })

//删除sku
// /admin/product/deleteSku/{skuId}
export const reqDeleteById = (skuId) => request({ url: `/admin/product/deleteSku/${skuId}`, method: "DELETE" })